﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户登录</title>
    <script src="/Themes/Js/init.js"></script>
    <link href="/Themes/Css/base.css" rel="stylesheet" />
    <style type="text/css">
        .login_bg { background: url(/Themes/images/property/bg.jpg) no-repeat center; width: 100%; height: 100%; }
        .login_bg .user_login { width: 410px; height: 370px; background: #fff; border-radius: 10px; padding: 25px 45px; position: absolute; left: 50%; top: 50%; margin-left: -250px; margin-top: -210px; box-shadow: 0px 0px 5px 1px #c2c2c2; footer; }
        .login_bg .user_login .logo { margin: 0 auto; display: block; margin-bottom: 15px; }
        .login_bg .user_login > h3 { font-size: 28px; line-height: 28px; text-align: center; }
        .login_bg .user_login > h3 span { color: #13A769; }
        .login_bg .user_login input { width: 270px; height: 45px; line-height: 45px; border: 0; font-size: 18px; text-indent: 10px; }
        .login_bg .user_login .user { width: 327px; height: 45px; line-height: 45px; border: 1px solid #CCCCCC; border-radius: 5px; margin: 0 auto; }
        .login_bg .user_login .user > span { width: 43px; height: 31px; line-height: 31px; display: inline-block; border-right: 1px solid #ccc; vertical-align: middle; background-position: center; background-repeat: no-repeat; }
        .login_bg .user_login .user_name { margin-top: 35px; }
        .login_bg .user_login .user_name > span { background-image: url(/Themes/images/property/name.png); }
        .login_bg .user_login .password { margin-top: 15px; }
        .login_bg .user_login .password > span { background-image: url(/Themes/images/property/Password.png); }
        .login_bg .user_login .btn_login { margin-top: 35px; }
        .login_bg .user_login .btn_login > button { display: block; background: #13a769; width: 140px; height: 50px; line-height: 50px; text-align: center; color: #fff; font-size: 22px; border-radius: 5px; border: 0; cursor: pointer; margin: 0 auto; letter-spacing: 3px; }
        .footer { color: #fff; font-size: 12px; text-align: center; position: absolute; width: 466px; left: 50%; bottom: 3%; margin-left: -233px; }
        .footer img { width: 100px; height: 100px; }
        .footer p { line-height: 40px; }
    </style>

</head>
<body>
    <div class="login_bg">
        <div class="footer">
            <p>CopyRight @ 2015-2018&emsp;&emsp;</p>
        </div>
        <div class="user_login">
            <img src="/Themes/images/property/logo1.png" class="logo" />
            <h3>测试后台管理系统</h3>
            <div class="user user_name">
                <span></span>
                <input type="text" name="login_name" id="login_name" placeholder="请输入用户名" />
            </div>
            <div class="user password">
                <span></span>
                <input type="password" name="PassWord" id="PassWord" placeholder="请输入密码" />
            </div>
            <div class="btn_login">
                <button id="LoginButton" type="button" onclick="login();">登录</button>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        function login() {
            $.InvokeAjax({
                url: "Login/Login",

                data: { login_name: $.GetValue("login_name"), password: $.GetValue("PassWord") },
                callBack: function (obj) { 
                    if (obj.Data != null) {

                        Cookies.set('login_token', obj.Data.login_token, { expires: 1, path: '/' });//添加                     

                        Cookies.set('login_name', obj.Data.login_name, { expires: 1, path: '/' });
                        Cookies.set('user_name', obj.Data.user_name, { expires: 1, path: '/' });
                        Cookies.set('userid', obj.Data.userid, { expires: 1, path: '/' }); 

                        location.href = "/Main.aspx";
                    }
                    else {
                        layer.alert('用户名或密码不正确!');
                    }
                }
            });
        }
    </script>
</body>
</html>